﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace apparatus
{
    public partial class main_add : Form
    {
        public main_add()
        {
            InitializeComponent();
        }

        private void mainBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.mainBindingSource.EndEdit();
            this.tableAdapterManager.UpdateAll(this.db1DataSet);

        }

        private void main_add_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“db1DataSet.main”中。您可以根据需要移动或移除它。
            // this.mainTableAdapter.Fill(this.db1DataSet.main);

        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.mainTableAdapter.InsertQuery(number1TextBox.Text,
                name1TextBox.Text,
                type1TextBox.Text,
                unit1TextBox.Text,
                person1TextBox.Text);
            MessageBox.Show("添加成功!");
            number1TextBox.Text="";
                name1TextBox.Text="";
                type1TextBox.Text="";
                unit1TextBox.Text="";
                person1TextBox.Text="";
        }
    }
}
